package com.xyh;

import org.apache.http.Consts;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import javax.swing.text.html.parser.Entity;

public class EncryptMain {
    public static void main(String [] args) throws  Exception{
        CloseableHttpClient closeableHttpClient= HttpClients.createDefault();
        HttpPost post=new HttpPost("http://localhost:8911/encrypt");
        HttpEntity httpEntity=new StringEntity("crazyit", Consts.UTF_8);
        post.setEntity(httpEntity);
        HttpResponse response=closeableHttpClient.execute(post);
        System.out.print(EntityUtils.toString(response.getEntity()));
    }
}
